<div id="bloque-calendario" class="sidebar seccion">
	<div class="calendar-widget-title">calendario</div>
	<div id="calendar"></div>
</div>

@section('css')
	@parent
	{{ HTML::style('assets/js/kalendar/kalendar.css') }}
@stop


@section('js')
	@parent
	
	<?php use Carbon\Carbon; ?>
	
	{{ HTML::script('assets/js/kalendar/kalendar.js') }}
	<script>
		$(document).ready(function() {
			$('#calendar').kalendar({
				events: [
					@foreach(Torneo::all() as $torneo)
					<?php $dt = Carbon::createFromFormat('Y-m-d H:i:s', $torneo->fecha) ?>
					
					{
						title:"{{ $torneo->titulo }}",
						url: "{{ URL::route('torneo.detalle',$torneo->id) }}",
						start: {
							date: {{ $dt->format('Ymd') }},
							time: "{{ $dt->format('H.i') }}"
						},
						end: {
							date: {{ $dt->addHours($torneo->duracion)->format('Ymd') }},
							time: "{{ $dt->format('H.i') }}"
						},
						location: "{{ $torneo->campo->nombre }}",
						color: "yellow"
		
					},
					@endforeach
					
				],
				color: "blue",
				firstDayOfWeek: "Monday",
				dayHuman:[
							["D","Domingo"],
							["L","Lunes"],
							["M","Martes"],
							["X","Miercoles"],
							["J","Jueves"],
							["V","Viernes"],
							["S","Sabado"]
						],
				monthHuman:[
								["ENE","Enero"],
								["FEB","Febrero"],
								["MAR","Marzo"],
								["ABR","Abril"],
								["MAY","Mayo"],
								["JUN","Junio"],
								["JUL","Julio"],
								["AGO","Agosto"],
								["SEP","Septiembre"],
								["OCT","Octubre"],
								["NOV","Noviembre"],
								["DIC","Diciembre"]
							],
				eventcolors: {
					yellow: {
						background: "#FC0",
						text: "#000",
						link: "#000"
					},
					blue: {
						background: "#6180FC",
						text: "#FFF",
						link: "#FFF"
					}
				},
				urlText: "Mas detalles"
			});
		
		});
	</script>
@stop